@echo off

rem Check the javac.exe file
if exist "%JAVA_HOME%\bin\javac.exe" goto okJavaC
echo The JAVA_HOME environment variable is not defined correctly
echo This environment variable is needed to run this program
goto end

:okJavaC
rem Check the rmic.exe file
if exist "%JAVA_HOME%\bin\rmic.exe" goto okRmiC
echo The JAVA_HOME environment variable is not defined correctly
echo This environment variable is needed to run this program
goto end

:okRmiC
SET TEMP_PATH=org\edu\uvt\softwareSystemsArchitectures\lab5\systemDefault
"%JAVA_HOME%\bin\javac.exe" -d .\ *.java
"%JAVA_HOME%\bin\rmic.exe" d_Data
"%JAVA_HOME%\bin\rmic.exe" d_Logic

:end